package cn.kgc.service.impl;

import cn.kgc.mapper.OrderMapper;
import cn.kgc.pojo.Order;
import cn.kgc.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 肖天锴
 * @version 1.0
 * @date 2022/10/7 - 17:16
 */
@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public int addOrder(Order orders) {
        return orderMapper.addOrder(orders);
    }

    @Override
    public Order find(Integer orderId) {
        return orderMapper.find(orderId);
    }

    @Override
    public List<Order> showDetail(Integer currentPage,Integer limit,String clientName,String orderState) {
        return orderMapper.showDetail(currentPage,limit,clientName,orderState);
    }

    @Override
    public int getTotalPage(String clientName,String orderState) {
        return orderMapper.getTotalPage(clientName,orderState);
    }

    @Override
    public int update(Order order){
        return orderMapper.update(order);
    }

    @Override
    public Order findById(Integer orderId) {
        return orderMapper.findById(orderId);
    }

    @Override
    public int updateById(Order order) {
        return orderMapper.updateById(order);
    }

    @Override
    public Order findByClientId(Integer clientId) {
        return orderMapper.findByClientId(clientId);
    }

    @Override
    public Order findByOrderId(Integer orderId) {
        return orderMapper.findByOrderId(orderId);
    }

    @Override
    public Order findByOrderId1(Integer orderId) {
        return orderMapper.findByOrderId1(orderId);
    }

    @Override
    public int changeState(Integer orderId) {
        return orderMapper.changeState(orderId);
    }

    @Override
    public int changeState1(Integer orderId) {
        return orderMapper.changeState1(orderId);
    }
}
